package ua.kpi_java_training5.kereia.module2;
import java.util.Random;
/**
 * Created with IntelliJ IDEA.
 * User: Alex
 * Date: 30.05.13
 * Time: 17:15
 * To change this template use File | Settings | File Templates.
 */
public class Victim extends Fish {
    private final int MAX_STEPS = 1;
    private Random rand;
    Victim(int width, int length, int aquariumWidth, int aquariumLength) {
        super(width, length, aquariumWidth, aquariumLength);
        rand = new Random();
    }
    @Override
    public void go() {
        boolean checkDirection = true;
        while(checkDirection) {
            int direction = rand.nextInt(4);
        switch (direction) {
            case 0: checkDirection = stepControl("UP", MAX_STEPS);
                break;
            case 1: checkDirection = stepControl("DOWN", MAX_STEPS);
                break;
            case 2: checkDirection = stepControl("RIGHT", MAX_STEPS);
                break;
            case 3: checkDirection = stepControl("LEFT", MAX_STEPS);
                break;
        }

        }
    }
}
